<template>
  <div class="Message-card">
    <button class="exit mdui-btn mdui-btn-icon" @click="exit()">
      <i class="mdui-icon material-icons">exit_to_app</i>
    </button>
    <div id="body">
      <div id="content">
        <vue-qr
          class="code"
          :correctLevel="3"
          :autoColor="false"
          colorDark="black"
          :text="codeUrl"
          :size="200"
          :margin="0"
          :logoMargin="3"
        ></vue-qr>
        <vue-qr
          class="code-scan"
          :correctLevel="3"
          :autoColor="false"
          colorDark="black"
          :text="codeUrl"
          :size="200"
          :margin="0"
          :logoMargin="3"
        ></vue-qr>
        <div class="solid"></div>
      </div>
    </div>
  </div>
</template>

<script>
import VueQr from 'vue-qr'

export default {
  components: {
    VueQr
  },
  props: {
    codeUrl: String
  },
  data () {
    return {
      logoSrc: '',
      bgSrc: ''
    }
  },
  methods: {
    exit () {
      console.log('exit')
      this.$emit('exit', '')
    }
  }
}
</script>

<style scoped>
:root {
  --theme-color: white;
  --bg-w-pure: rgb(65, 145, 245);
  --with: 300px;
  --parameter: 3s ease-in-out infinite;
}

#content {
    position: relative;
    margin-bottom: 25px;
    animation: showQRC .35s ease-in-out;
}

@keyframes showQRC {
  0%{
    opacity: 0;
  }100%{
    opacity: 1;
  }
}
.code{
    position: absolute;
    clip-path: none;
}

p {
  display: block;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
}
.download-btn {
  border-radius: 10px;
  cursor: pointer;
  display: block;
  font-size: 13.3px;
  height: 49px;
  margin-bottom: 20px;
  transition: background-color 0.25s, box-shadow 0.25s, color 0.25s,
    opacity 0.25s;
  width: 100%;
  max-width: 224px;
  /* ↑ button main */
  flex-grow: 2;
  background-color: var(--bg-w-pure);
  border: none;
  box-shadow: 0 5px 20px rgb(65 145 245 / 20%);
  color: var(--theme-color);
  outline: none;
}

.exit {
  margin: 10px auto 10px 25px;
}
.Message-card {
  background: #ffffff;
  box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
  border-radius: 1em;
  width: 80vw;
  max-width: 600px;
  margin: 0 auto 100px;
  padding: 5px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
</style>
